import request from './../utils/request'

export default {
  // 登录认证
  login (username, password) {
    return request({
      url: 'user/login',
      method: 'post',
      data: {
        username,
        password
      }
    })
  },
  // 获取用户信息
  getUserInfo (token) {
    return request({
      url: `/user/info/${token}`,
      method: 'get'
    })
  },
  // 退出系统
  logout (token) {
    return request({
      url: 'user/logout',
      method: 'post',
      data: { token }
    })
  }
}
